<div id="maincontent">

<%= render :partial => "shared_common_files/data_area_help_bar" %>

	<% for name in [:simplemsg] %>
    	<% if flash[name] %>
      		<%= "<div class='message-justmsg'> #{flash[name]} </div>" %>
    	<% end %>
  	<% end %>
  
    <% for name in [:notice, :warning, :message] %>
    	<% if flash[name] %>
      		<%= "<div class='message-fatal'> #{flash[name]} </div>" %>
    	<% end %>
  	<% end %>
  	
<%if (params['node'] == "basecamp") %>
	
	<h2>Basecamp > Browse Projects</h2>
	
	<%if (@projects.length == 1) %> 
		<h5>There is only 1 project. Which are as follows</h5>
	<%elsif(@projects.length > 1)%>
		<h5>There are "<%=@projects.length%>" projects. Which are as follows</h5>
	<%elsif(@projects.length < 1)%>
		<h5>Sorry, there are "<%=@projects.length%>" project.</h5>
	<%end%>
	
	<div class="list">
		<table id="browse_projects">
  			<tr>
				<th>Projects Name</th>
				<th>Actions</th>
  			</tr>
  		
			<% count=1;%>	  
			<% rowtype="odd";%>
	
			<%for project in @projects%>
	
			<%if(isodd(count))%>
				<% rowtype="odd";%>
			<%else%>
				<% rowtype="even";%>
			<%end%>  
			
			<tr class="<%=rowtype%>">
				<td><!-- a href="/integration/objectdetail?node=<%=params['node']%>&name=<%=project.name%>" --><%=project.name%></td>
		 	<td>
		 	
             <%if(canRequestLink("integration","saverecord"))%>
					<a href="/integration/saverecord?module=Project&name=<%=project.name%>">Create in SugarCRM</a>
			 <%end%>
			 &nbsp;&nbsp;
			 <%if(canRequestLink("integration","todolist"))%>
					<a href="/integration/todolist?node=<%=params['node']%>&name=<%=project.name%>&id=<%=project.id%>">To-Do list</a>
			 <%end%>
             </td>
		 	</tr>
		 	
		 	<% count = count + 1 %>
				
			<%end%>
		</table>
	</div>
<%end%>

<br/>
<div class="list">

	<table>
	     <th>Action</th>
         <tr class="even">
            <td>
            <a href="javascript:history.go(-1);"><img src="/themes/odotclassic/images/btn_cancel.gif"/></a>
              
            </td>
         </tr>  
               
	</table>

</div>
</div>